package com.falser.user.service.impl;

import com.falser.common.util.FileUtil;
import com.falser.user.service.FileService;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@Service
public class FileServiceImpl implements FileService {

    private final FileUtil fileUtil;

    public FileServiceImpl(FileUtil fileUtil) {
        this.fileUtil = fileUtil;
    }

    @Override
    public String upload(MultipartFile file) throws IOException {
        return fileUtil.upload(file.getInputStream());
    }
}